package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionDemo3 {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("张三丰");
        list.add("张翠山");
        list.add("张无忌");
        System.out.println("list = " + list);


        Iterator<String> it = list.iterator();
        while (it.hasNext()){
            String name = it.next();
            System.out.println("name = " + name);
        }
        System.out.println("it = " + list);
    }
}

